<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/page.css" rel="stylesheet">
    <!-- 全局js -->
    <script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/admin/js/plugins/layer/layer.min.js"></script>
    <script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/admin/js/plugins/validate/jquery.validate.min.js"></script>
    <!-- iCheck -->
    <script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/admin/js/common/admin.js"></script>
    <script src="__PUBLIC__/admin/js/common/ajax.js"></script>
</head>

<script>
    var url = "/{$Request.module}/goods";
    var deleteUrl = "{:url('goods/deleteIsLive')}";
</script>

<body class="gray-bg">
<style>
    .qiehuan{
        width:120px; height:40px; line-height:40px; font-size:14px; font-weight:bold; color:#333; background-color:#F5F5F6; float:left; margin-right:10px; text-align:center; cursor:pointer;
    }
    .integral-box{
        text-align: center;
        color: #ff0000;
        border: 1px solid #ff0000;
        border-radius: 3px;
        padding: 3px;
        width: 180px;
        line-height: normal;
        margin-bottom: 3px;
    }
</style>
<div class="wrapper wrapper-content" id="server">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{if condition="isset($cate_name) && $cate_name"}{$cate_name}{/if}商品列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row" style="margin-top:10px;margin-bottom:20px;">
                        <form action="{:url('goods/search')}" method="post" id="form_search">

                            <div class="col-sm-3 m-b-xs">
                                <button type="button" class="btn btn-sm btn-primary" id="addgoods" style="margin-right:15px;"><i class="fa fa-plus" style="color:#FFF;"></i>&nbsp;增加商品</button>
                            </div>
                            <div class="col-sm-3" style="float:right;">
                                <div class="input-group">
                                    <input type="text" name="keyword" placeholder="请输入商品名称" {if condition="isset($goods_name) && $goods_name"}value="{$goods_name}"{/if} class="input-sm form-control"> <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary" id="submit_search2">搜索</button></span>
                                </div>
                            </div>

                            <div style="float:right; font-size:15px;">
                                <select style="height:30px; line-height:30px; border:1px solid #e5e6e7;" name="onsale">
                                    <option value="0" {if condition="isset($onsale) && $onsale eq 0"}selected="selected"{/if}>所有状态</option>
                                    <option value="1" {if condition="isset($onsale) && $onsale eq 1"}selected="selected"{/if}>上架</option>
                                    <option value="2" {if condition="isset($onsale) && $onsale eq 2"}selected="selected"{/if}>下架</option>
                                </select>
                            </div>


                            <div style="float:right; margin-right:10px; font-size:15px;">
                                <select style="height:30px; line-height:30px; border:1px solid #e5e6e7;" name="attr">
                                    <option value="0" {if condition="isset($attr) && $attr eq 0"}selected="selected"{/if}>所有标签</option>
                                    <option value="is_special" {if condition="isset($attr) && $attr eq 'is_special'"}selected="selected"{/if}>特价</option>
                                    <option value="is_new" {if condition="isset($attr) && $attr eq 'is_new'"}selected="selected"{/if}>新品</option>
                                    <option value="is_hot" {if condition="isset($attr) && $attr eq 'is_hot'"}selected="selected"{/if}>热销</option>
                                    <option value="is_recommend" {if condition="isset($attr) && $attr eq 'is_recommend'"}selected="selected"{/if}>推荐</option>
                                </select>
                            </div>


                            <div style="float:right; margin-right:10px; font-size:15px;">
                                <select style="height:30px; line-height:30px; border:1px solid #e5e6e7;" name="brand_id">
                                    <option value="0" {if condition="isset($brand_id) && $brand_id eq 0"}selected="selected"{/if}>所有品牌</option>
                                    {foreach name="brandres" item="v"}
                                    <option value="{$v.id}" {if condition="isset($brand_id) && $brand_id eq $v['id']"}selected="selected"{/if}>{$v.brand_name}</option>
                                    {/foreach}
                                </select>
                            </div>

                            <div style="float:right; margin-right:10px; font-size:15px;">
                                <select style="height:30px; line-height:30px; border:1px solid #e5e6e7;" name="cate_id">
                                    <option value="0" {if condition="isset($cate_id) && $cate_id eq 0"}selected="selected"{/if}>所有分类</option>
                                    {foreach name="cateres" item="v"}
                                    <option value="{$v.id}" {if condition="isset($cate_id) && $cate_id eq $v['id']"}selected="selected"{/if}>{:str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $v['level'])}{if condition='$v["level"] gt 0'}|{/if}{$v.html}{$v.cate_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <input type="hidden" name="oper" value="live"/>
                        </form>

                    </div>


                    <div id="ajaxpagetest">
                        {include file="goods/liveajaxpage" /}
                    </div>


                </div>
            </div>
        </div>
    </div>
</div>



<script type="text/javascript">
    $(function(){

        $('#addgoods').click(function(){
            location.href=url+'/liveadd';
        });

    });
    //获取选择的值
    function selectGoods(){
        var ids=[];
        var r = document.getElementsByName("id[]");
        for (var i = 0; i < r.length; i++) {
            if(r[i].checked){
                ids[i]=r[i].value;
            }
        }
        if(ids == ''){
            layer.msg('请选择商品', {icon: 2,time: 1000});
            return false;
        }
        var goodsurl="{:url('goods/setcate')}";
        layer.open({
            type: 2,
            title: '批量修改分类',
            shadeClose: true,
            shade: 0.3,
            area: ['70%', '80%'],
            content: goodsurl,
            success: function (layero, index) {
                //找到它的子窗口的body
                var body = layer.getChildFrame('body', index);
                //为子窗口元素赋值
                body.contents().find("#ids").val(ids);
            }
        });
    }

    function call_backcate(){
        location.href = url+'/lst?page='+pnum;
    }
    //库存
    function product(id,obj){
        location.href=url+'/product/id/'+id;
    }
    function deleteIsLive(id) {
        var deleteUrl = "{:url('goods/deleteIsLive')}";
    }
</script>

</body>
</html>